<?php

namespace app\admin\model\sales;

use think\Model;

/**
 * Prices
 */
class Prices extends Model
{
    // 表主键
    protected $pk = 'stockid';
    
    // 表名
    protected $name = 'sales_prices';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function stockidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\stock\Stockmaster::class, 'stockid', 'stockid');
    }

    public function typeabbrevTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\sales\Salestypes::class, 'typeabbrev', 'typeabbrev');
    }

    public function currabrevTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Currencies::class, 'currabrev', 'currabrev');
    }

    public function debtornoTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\sales\Debtorsmaster::class, 'debtorno', 'debtorno');
    }

    public function branchcodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\sales\Custbranch::class, 'branchcode', 'branchcode');
    }
}